#pragma once


#include "Message.h"

#include "PhysicsModuleMessages.h"


namespace _MMESSAGE_
{
	namespace _PHYSICS_
	{

		
		class PhysicsPropertyMessageBase: 
			public _FOGGE_::_MSG_::Message
		{
		public:
			_FOGGE_::_GDB_::foDataObject* m_ptrObject;
		};

		class PMM_ChangeVelocity: 
			public PhysicsPropertyMessageBase
		{
			FoDeclareRegisterFuntion(PMM_ChangeVelocity);
		public:
			/*virtual*/
			void ClearData()
			{
				m_vVelocity.reset();
			}

			_FOMATH::Vector m_vVelocity;
		};

		class PMM_ChangeAngularVelocity: 
			public PhysicsPropertyMessageBase
		{
			FoDeclareRegisterFuntion(PMM_ChangeAngularVelocity);
		public:
			/*virtual*/
			void ClearData()
			{
				m_rAngularVelocity.set(0,0,0);
			}

			_FOMATH::Rotator m_rAngularVelocity;
		};

		void RegisterPhysicsPropertyMessages(::_FOGGE_::_MSG_::MessageManager* ptrMessagaManager);
		
	}
}


#define SendChangeVelocityMessage(part,newVel) \
{\
	_PMMSG::PMM_ChangeVelocity *ptrCV=FoDynamicCast(_PMMSG::PMM_ChangeVelocity,GetNewMassage(_PMMSG::ePMM_ChangeVelocity ));\
	ptrCV->m_vVelocity=newVel;\
	ptrCV->m_ptrObject=part->GetOwner();\
	ptrCV->PushReceiver(_FOGGE_::eEMID_Physics);\
	SendMessage(ptrCV);\
}